import { OrderPage } from './../pages/order/order';
import { SearchResultPage } from './../pages/search-result/search-result';
import { TabsPage } from './../pages/tabs/tabs';
import { UserPage } from './../pages/user/user';
import { CartPage } from './../pages/cart/cart';
import { CategoryPage } from './../pages/category/category';
import { IndexPage } from './../pages/index/index';
import { NextPage } from './../pages/next/next';
import { BrowserModule } from '@angular/platform-browser';
import { ErrorHandler, NgModule } from '@angular/core';
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
import { SplashScreen } from '@ionic-native/splash-screen';
import { StatusBar } from '@ionic-native/status-bar';
import { HttpClientModule } from '@angular/common/http';
import { MyApp } from './app.component';
import { HomePage } from '../pages/home/home';
import { IonicStorageModule } from "@ionic/storage";
import { ApiProvider } from '../providers/api/api';
import { UserProvider } from '../providers/user/user';
import { AlertProvider } from '../providers/alert/alert';

@NgModule({
  declarations: [
    MyApp,
    HomePage,
    NextPage,
    IndexPage,
    CategoryPage,
    CartPage,
    UserPage,
    TabsPage,
    SearchResultPage,
    OrderPage,
  ],
  imports: [
    BrowserModule,
    // 统一各平台样式
    IonicModule.forRoot(MyApp, {
      backButtonText: '返回',
      mode: 'ios'
    }),
    HttpClientModule,

    // Storage 设置
    IonicStorageModule.forRoot({
      name: '__clm',
      driverOrder: ['indexeddb', 'sqlite', 'websql']
    }),
  ],
  bootstrap: [IonicApp],
  entryComponents: [
    MyApp,
    HomePage,
    NextPage,
    IndexPage,
    CategoryPage,
    CartPage,
    UserPage,
    TabsPage,
    SearchResultPage,
    OrderPage,
  ],
  providers: [
    StatusBar,
    SplashScreen,
    {provide: ErrorHandler, useClass: IonicErrorHandler},
    ApiProvider,
    UserProvider,
    AlertProvider
  ]
})
export class AppModule {}
